<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function addMore() {
		//创建所要添加的元素节点
		var tdElement=document.getElementById('more');
        var fileElement=document.createElement('input');
        fileElement.type='file';
        fileElement.name='fileupload';
        var buttonElement=document.createElement('input');
        buttonElement.type='button';
        buttonElement.value='remove';
        buttonElement.onclick=function(){
            tdElement.removeChild(fileElement);
            tdElement.removeChild(brElement);
            tdElement.removeChild(buttonElement);
        }
        var brElement=document.createElement('br');
        //把创建的元素节点添加到html文件里
        tdElement.appendChild(fileElement);
        tdElement.appendChild(buttonElement);
        tdElement.appendChild(brElement);

	}
</script>
</head>
<body>
<form method="post" action="${pageContext.request.contextPath}/fileuploadhandler/fileupload01.do" enctype="multipart/form-data">
    <table align="center" width="50%" border="1">

        <tr>
            <td>
                file
            </td>

            <td id="more">
                <input type="file" name="fileupload"/><input type="button" value="Add More.." onclick="addMore()"><br>
            </td>
        </tr>


    </table>

    <input type="submit" value="提交">
    <input type="reset" value="重置">

</form>
</body>
</html>